var Group = function(groupId,groupName){
	this.groupId = groupId;
	this.groupName = groupName;
	this.staffArray = new Array();
	this.campaignArray = new Array();
}
var Staff = function(staffId,staffName){
	this.staffId = staffId;
	this.staffName = staffName;
}

var Campaign = function(campaignId,campaignName){
	this.campaignId = campaignId;
	this.campaignName = campaignName;
}

function groupChange(groupSelect){
	var groupId = groupSelect.value;
	var staffSelect = document.forms["reportForm"].staffId;
	var campaignSelect = document.forms["reportForm"].campaignId;
	staffSelect.length = 0;
	campaignSelect.length = 0;
	for(i = 0;i < groupArray.length;i++){
		if(groupArray[i].groupId == groupId){
			var groupObj = groupArray[i];
			var defaultOption1 = new Option("--全部--","");
			var defaultOption2 = new Option("--全部--","");
			staffSelect.add(defaultOption1);
			campaignSelect.add(defaultOption2);
			for(is = 0;is < groupObj.staffArray.length;is++){
				var option = new Option(groupObj.staffArray[is].staffName,groupObj.staffArray[is].staffId);
				staffSelect.add(option);
			}
			
			for(is = 0;is < groupObj.campaignArray.length;is++){
				var option = new Option(groupObj.campaignArray[is].campaignName,groupObj.campaignArray[is].campaignId);
				campaignSelect.add(option);
			}
			break;
		}
	}
}